package com.example.administrator.aidlapplication.binder;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.os.RemoteException;
import android.support.annotation.Nullable;

import com.example.administrator.aidlapplication.IOperation;

/**
 * Created by Administrator on 2016/10/12 0012.
 */

public class BinderService extends Service {

    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        return new ServiceImpl();
    }
    //TODO 2实现服务端
    public class ServiceImpl extends IOperation.Stub{

        @Override
        public int add(int a, int b) throws RemoteException {
            return a+b;
        }
    }
}
